--- 'TokenID' and associated instances
module frege.compiler.enums.TokenID where 

{--
    The tokens for the frege language.
    -}

data TokenID =
    CHAR
    | DOCUMENTATION | COMMENT
    | QUALIFIER | VARID | CONID
    | INTCONST  | STRCONST  | CHRCONST | BIGCONST
    | FLTCONST  | LONGCONST  | DBLCONST  | DECCONST | REGEXP
    | DCOLON    | ARROW  | GETS | EARROW | DOTDOT
    | EXTENDS   | SUPER                             -- generic kinds ≤ (extends) and ≥ (super)
    | PACKAGE   | IMPORT  | NATIVE
    | IF  | THEN  | ELSE  | CLASS  | WHERE
    | INSTANCE
    | DATA  |  CASE  | OF  | DERIVE
    | LET  | IN  | TYPE  | TRUE  | FALSE | PURE
    | PRIVATE  | PUBLIC  | PROTECTED | ABSTRACT | DO  | FORALL
    | THROWS        --- used to mark native methods that throw
    | MUTABLE       --- used to mark always mutable native data
    | DEFAULT | NEWTYPE | FOREIGN  -- Haskell  
    | INFIX  | INFIXL  | INFIXR
    -- left, right and non associative operators with precedence order 1 to 16
    | LOP0
    | LOP1   | LOP2   | LOP3   | LOP4
    | LOP5   | LOP6   | LOP7   | LOP8
    | LOP9   | LOP10  | LOP11  | LOP12
    | LOP13  | LOP14  | LOP15  | LOP16
    | ROP0
    | ROP1   | ROP2   | ROP3   | ROP4
    | ROP5   | ROP6   | ROP7   | ROP8
    | ROP9   | ROP10  | ROP11  | ROP12
    | ROP13  | ROP14  | ROP15  | ROP16
    | NOP0
    | NOP1   | NOP2   | NOP3   | NOP4
    | NOP5   | NOP6   | NOP7   | NOP8
    | NOP9   | NOP10  | NOP11  | NOP12
    | NOP13  | NOP14  | NOP15  | NOP16
    | SOMEOP                -- pseudo operator token
    | LEXERROR

defaultInfix = LOP16

derive Show TokenID


derive Eq TokenID


derive Ord TokenID


derive Enum TokenID


